package com.nf.action;

import com.nf.Tax.ITaxUtil;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class test3 {
    private ITaxUtil i2;

    @RequestMapping("/action")
    public String a1(Model model,float a){
        ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        i2 = (ITaxUtil) ac.getBean("t1");
        System.out.println(i2.calaTax(a));
        model.addAttribute("i2",i2.calaTax(a));
        return "tax";
    }
}
